/*#include "reg52.h"

typedef unsigned int u16;//类型重定义
typedef unsigned char u8;

sbit LED1 = P2^0;
sbit LED2 = P2^3;

void delay_10ms(unsigned int i) //(u16 i)
{
  while(i--);
}

void main()
{
  while(1)
	{
	  /*LED1 = 0;
		LED2 = 1;
		delay_10ms(50000);
		delay_10ms(50000); //延时1s
		LED1 = 1;
		LED2 = 0;
		delay_10ms(50000);
		delay_10ms(50000); //延时1s
		
		LED1 = 0;
		delay_10ms(50000);
		LED1 = 1;
		delay_10ms(50000);
		LED2 = 0;
		delay_10ms(50000);
		LED2 = 1;
		delay_10ms(50000);
		
		
	}
}*/

#include "reg52.h"
#define LED P2
void delay(int i)//定义了一个有符号的整型参数 i   unsigned int  无符号    signed int = int 有符号
{
  while(i--);
}

void main()
{
  while(1)
	{
		//目前实现的是灯的交替亮灭   第一盏灯亮的同时，第二盏灯熄灭，第一盏灯熄灭的同时，第二盏灯亮
	    LED = 0xFE;//让第1个灯亮，其他所有灯都拜拜
		delay(50000);
		LED = 0xBF;//让第7个灯亮，其他灯都熄灭
		delay(50000);
	}
}
